package com.huanzhidadi.longid.controller;


import com.huanzhidadi.longid.model.ResultVO1;
import com.huanzhidadi.longid.model.ResultVO2;
import com.huanzhidadi.longid.util.IdWorker;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "longId")
public class LongIdController {

    @RequestMapping(value = "getResult1", method = RequestMethod.POST)
    public ResultVO1 getResult1() {
        ResultVO1 resultVO = new ResultVO1();
        resultVO.setId(IdWorker.nextId());
        resultVO.setName("原始Long输出");
        return resultVO;
    }

    @RequestMapping(value = "getResult2", method = RequestMethod.POST)
    public ResultVO2 getResult2() {
        ResultVO2 resultVO = new ResultVO2();
        resultVO.setId(IdWorker.nextId());
        resultVO.setName("单个字段注解方式");
        return resultVO;
    }


}
